

//定义骑兵子类，继承父类GameUtil
public class Cavalry extends GameUtil {
    public Cavalry() {
        //初始化骑士属性
        name ="骑兵";
        life = 80;
        attack = 15;
        defend = 12;
        hr = 0.75;
    }
    @Override
    public void dodge() {
        System.out.println(this.name+"身体一俯，逃过对方的攻击!");
    }
    public int getlife(){
        return life;
    }
}

